package com.thread;


import java.awt.*;

/**
 * @Author weijingchen
 * @Date 2025/6/22 22:55
 * @Version 1.0.0
 */
public class Test02 {

    public static void main(String[] args) {

        //同步代码块
        synchronized (Test02.class){
            System.out.println("hello world");
        }
    }
    //同部方法
    public synchronized  void test(){
        System.out.println("hello world");
    }



}
